gdk: Stop using gdk_surface_get_device_position
authorMatthias Clasen <mclasen@redhat.com>
Mon, 25 Mar 2019 12:32:10 +0000 (08:32 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 26 Mar 2019 21:55:29 +0000 (17:55 -0400)
Use the double variant instead.

gdk/wayland/gdksurface-wayland.c
gdk/win32/gdkdevice-win32.c

index 26d62a9453970823325d6c6d0587db211b0698b7..1be048e7a8d8330dfad69edb53e23d69564e7e6b 100644 (file)
@@ -2465,8 +2465,13 @@ gdk_wayland_surface_map (GdkSurface *surface)
            * position of the device that holds the grab.
            */
           if (impl->position_method == POSITION_METHOD_NONE && grab_device)
-            gdk_surface_get_device_position (transient_for, grab_device,
-                                            &surface->x, &surface->y, NULL);
+            {
+              double px, py;
+              gdk_surface_get_device_position_double (transient_for, grab_device,
+                                                      &px, &py, NULL);
+              surface->x = round (px);
+              surface->y = round (py);
+            }
         }
       else
         {
index 3fa381cae09e1b460cae25097b42ceb6e0ad98ad..3987e2c5df17736beeb8bee30afb5938c2d99149 100644 (file)
@@ -45,14 +45,14 @@ gdk_device_win32_get_state (GdkDevice       *device,
                             gdouble         *axes,
                             GdkModifierType *mask)
 {
-  gint x_int, y_int;
+  double x, y;
 
-  gdk_surface_get_device_position (window, device, &x_int, &y_int, mask);
+  gdk_surface_get_device_position_double (window, device, &x, &y, mask);
 
   if (axes)
     {
-      axes[0] = x_int;
-      axes[1] = y_int;
+      axes[0] = round (x);
+      axes[1] = round (y);
     }
 }